package cn.java.demo;


class JPen
{
    protected String brand;   //品牌
    protected String nib;     //笔尖
    public static int weight=21;   //重量
    public final static double PI=3.1415926;

    public JPen(String brand, String nib)
    {
        this.brand = brand;
        this.nib = nib;
    }

    public String getBrand()
    {
        return brand;
    }

    public String getNib()
    {
        return nib;
    }

    public void setBrand(String brand)
    {
        this.brand = brand;
    }

    public void setNib(String nib)
    {
        this.nib = nib;
    }

    public String penInfo()
    {
        String msg=String.format("品牌:%s,笔尖:%s",this.brand,this.nib);
        System.out.println(msg);
        return msg;
    }
}

public class StaticDemo
{
    public static void main(String[] args)
    {
        JPen pen=new JPen("英雄100","14K");
        System.out.println(String.format("钢笔重%d克",JPen.weight));
        pen.penInfo();
        //JPen.PI=4;
    }
}
